package com.citycloud.ccuap.tc.admin.model;

import com.citycloud.ccuap.commons.json.CheckedTreeNode;
import com.citycloud.ccuap.commons.sys.entity.SysRole;
import lombok.Data;

import java.util.Collection;
import java.util.List;

@Data
public class SecRole {
    /**cuapp原生role*/
    private SysRole originalRole;
    private String objId;
    private String code;
    private String name;
    private Short dataStatus;
    /**功能权限集合(树型结构)*/
    private List<CheckedTreeNode> funcPermissions;
    /**数据权限集合*/
    private Collection<String> dataPermissions;

    public SysRole getOriginalRole() {
        return originalRole;
    }

    public void setOriginalRole(SysRole originalRole) {
        this.originalRole = originalRole;
        this.objId = String.valueOf(originalRole.getRoleId());
        this.code = String.valueOf(originalRole.getRoleCode());
        this.name = String.valueOf(originalRole.getRoleName());
        this.dataStatus = originalRole.getDataStatus();
    }
    
    public void clearOriginalRole() {
        this.originalRole = null;
    }

}
